/* 
存放用户信息的共享文件
*/

import {defineStore} from "pinia"

export let userPiniaStore = defineStore("user1",{
    state:()=>{
        return{
            userName:"tom",
            age:10
        }
    },
    getters:{
        getAge(){
            return this.age
        },
        getName:(state)=>{
            return state.userName
        }
    },
    actions:{
        doubleAge(){
            this.age*=2;
        }
    }
})